<template>
  <div class="main">
    <el-table
      :data="tableData"
      border
      style="width: 100%">
      <el-table-column
        fixed
        prop="account"
        label="帐号">
      </el-table-column>
      <el-table-column
        prop="id"
        label="ID">
      </el-table-column>
      <el-table-column
        prop="name"
        label="持有人">
      </el-table-column>
      <el-table-column
        prop="state"
        label="帐号情况">
      </el-table-column>
      <el-table-column
        fixed="right"
        label="操作">
        <template slot-scope="scope">
          <el-button size="small" type="text" @click="handleClick(scope.row)">编辑</el-button>
          <el-button type="text" size="small">停用</el-button>
          <el-button type="text" size="small">移除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'AccountMain',
  data() {
    return {
      tableData: [{
        account: '123456',
        id: '555',
        name: '王小虎',
        state: '正常'
      }, {
        account: '123456',
        id: '555',
        name: '王小虎',
        state: '正常'
      }, {
        account: '123456',
        id: '555',
        name: '王小虎',
        state: '正常'
      }, {
        account: '123456',
        id: '555',
        name: '王小虎',
        state: '停用'
      }]
    }
  },
  methods: {
    handleClick(row) {
      console.log(row)
    }
  }
}
</script>

<style lang="stylus" scoped>
  .main
    padding-top 20px
</style>
